package org.activision;

import org.activision.model.World;
import org.activision.net.ServerChannelHandler;
import org.activision.net.packet.Packets;
import org.activision.net.update.EntityUpdate;
import org.activision.task.TaskManager;
import org.activision.util.Logger;
import org.activision.util.MapData;
import org.activision.util.rs2cache.Cache;

public class Engine {
	
	private static final TaskManager entityExecutor = new TaskManager();
	private static final TaskManager worldExecutor = new TaskManager();
	public Engine() {
		
		Logger.log(this, "[Main]: Starting Activision...");
		new Cache();
		Logger.log(this, "Loaded cache data.");
		new MapData();
		Logger.log(this, "Loaded Mapdata configuration.");
		new Packets();
		Logger.log(this, "Loaded Packets.");
		new World();
		Logger.log(this, "Loaded update tasks, and World data.");
		new Thread(new EntityUpdate()).start();
		Logger.log(this, "Loaded Entity data and configuration.");
		new ServerChannelHandler();
		Logger.log(this, "Initialized server on port 43595.");
	}

	public static TaskManager getWorldExecutor() {
		return worldExecutor;
	}

	public static TaskManager getEntityExecutor() {
		return entityExecutor;
		
}
}
